//
$(function () {
	$("#time").text(hours+":"+minutes+":"+seconds);
	$("#begin").click(startTime);
	$("#stop").dblclick(stopTime);
	$("#suspend").click(suspendTime);
});
//$(startTime)
/*
$(document).ready( function() {
	$("p").click(function() {
		$(this).hide();
	});
}
);*/

var seconds = "00";
var minutes = "00";
var hours = "00";
function startTime() {
	seconds ++;
	seconds = checkTime(seconds);

	if(seconds >= 60) {
		seconds %= 60;
		seconds = checkTime(seconds);
		minutes++;
		minutes = checkTime(minutes);
	}

	if(minutes >= 60) {
		minutes %= 60;
		hours++;
		hours = checkTime(hours);
	}

	$("#time").text(hours+":"+minutes+":"+seconds);
	t = setTimeout('startTime()', 1000);
}

function checkTime(value) {
	return value < 10 ? '0'+value : value;
}

/*
$(document).ready(function() {
	$("input").click(function() {
		$(this).hide();
		$("p").hide();
	});
});*/

function suspendTime() {
	clearTimeout(t);
}

function stopTime() {
	clearTimeout(t);

	seconds = "00";
	minutes = "00";
	hours = "00";
	$("#time").text(hours+":"+minutes+":"+seconds);
}

$(function() {
	$(document).mousemove(function(e) {
		$("#position").text("X: "+e.pageX+", Y: "+e.pageY)
	});
});

